from pydantic import BaseModel
from typing import List


class FaceDataModel(BaseModel):
    target_face_url: str
    user_face_urls: List[str]

class RequestDataModel(BaseModel):
    target_video: str
    face_data: List[FaceDataModel] = []  # 默认为空列表
    frames: int = 15  # 带有默认值的字段
    shuiyin: bool = True  # 带有默认值的字段
    oss_name: str = "ali"  # 带有默认值的字段

    class Config:
        json_schema_extra = {
            "example": {
                "target_video": "https://ty-huanlian.oss-cn-shanghai.aliyuncs.com/test/test_1.mov",
                "face_data": [
                    {
                        "target_face_url": "http://ty-huanlian.oss-cn-shanghai.aliyuncs.com/swap_face%2F202311%2Fbest_face_0_1700020151_output_frame_4.jpg",
                        "user_face_urls": ["http://usfile.chaotuapp.com/uploads/android/user/1700029261092.jpg"]
                    },
                    {
                        "target_face_url": "http://ty-huanlian.oss-cn-shanghai.aliyuncs.com/swap_face%2F202311%2Fbest_face_1_1700020151_output_frame_6.jpg",
                        "user_face_urls": ["http://usfile.chaotuapp.com/uploads/android/user/1700026696556.jpg"]
                    }

                ],
                "frames": 15,
                "shuiyin": True,
                "oss_name": "ali"
            }
        }
